package com.newdream.annotation.service;

import com.newdream.annotation.mapper.UserMapper;
import com.newdream.annotation.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author: sanglei
 * @date: 2019-02-13 14:16
 * @description:
 */
@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;

    public User findUser(Integer id){
        return userMapper.selectByPrimaryKey(id);
    }

    public User save(User user){
        userMapper.insert(user);
        return user;
    }
}
